package com.example.disinfestation.controller;


import com.example.disinfestation.entity.Abouts;
import com.example.disinfestation.entity.Pest;
import com.example.disinfestation.service.AboutsService;
import com.example.disinfestation.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Random;

@Controller
public class AboutsController extends BaseController{
    @Autowired
    AboutsService aboutsService;


    @RequestMapping("selectAbouts")
    @ResponseBody
    public JsonResult<Abouts> selectAll(){
        JsonResult result = new JsonResult();
        try {
            Abouts data = aboutsService.selectAbouts();
            result.setState(SUCCESS);
            result.setData(data);
        }catch (Exception e){
            result.setMessage("出现异常");
        }
        return result;
    }





}
